package pl.com.hme.kody.pocztowe.ui;

import pl.com.hme.kody.pocztowe.R;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AboutFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// Inflate the layout for this fragment
		View root = inflater.inflate(R.layout.fragment_about, container, false);

        Button rateButton = (Button) root.findViewById(R.id.ButtonRate);
        
        rateButton.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
            	   //PackageManager manager = getActivity().getPackageManager();
            	   //PackageInfo info = manager.getPackageInfo(getActivity().getPackageName(), 0);
            	String pn = getActivity().getPackageName();
                getActivity().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + pn)));
            }
        });
        
        return root;
	}

}
